DecompressImage
TheDecompressImage
function allows your application to decompress a single-frame image into a pixel map structure. If you call this function when you have a picture open, the Image Compression Manager inserts the compressed image data into the picture.
pascal OSErr DecompressImage (Ptr data, ImageDescriptionHandle desc, PixMapHandle dst, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle mask);
data
- Points to the compressed image data. This pointer must contain a 32-bit clean address. If you use a dereferenced, locked handle, you must call the Memory Manager's
StripAddress
routine before you use that handle with this parameter.desc
- Contains a handle to the image description structure that describes the compressed image.
dst
- Contains a handle to the pixel map where the decompressed image is to be displayed. Set the current graphics port to the port that contains this pixel map.
srcRect
- Contains a pointer to a rectangle defining the portion of the image to decompress. This rectangle must lie within the boundary rectangle of the compressed image, which is defined by (0,0) and
((**desc).width,(**desc).height)
. If you want to decompress the entire source image, set this parameter tonil
. If the parameter isnil
, the rectangle is set to the rectangle structure of the image description structure.dstRect
- Contains a pointer to the rectangle into which the decompressed image is to be loaded. The compressor scales the source image to fit into this destination rectangle.
mode
- Specifies the transfer mode for the operation. The Image Compression Manager supports the same transfer modes supported by QuickDraw's
CopyBits
routine.mask
- Contains a handle to a clipping region in the destination coordinate system. If specified, the compressor applies this mask to the destination image. If you do not want to mask bits in the destination, set this parameter to
nil
.DESCRIPTION
TheDecompressImage
function presents a simplified interface to your application, eliminating some parameters for the sake of convenience.Note that the
DecompressImage
function is invoked through theStdPix
function (see "Working With the StdPix Function," which begins on page 3-141, for more information).SPECIAL CONSIDERATIONS
The graphics port and the graphics device should be set to the destination before you call theDecompressImage
function.RESULT CODES
noErr 0 No error paramErr -50 Invalid parameter specified memFullErr -108 Not enough memory available noCodecErr -8961 The Image Compression Manager could not find the specified compressor SEE ALSO
If you need to exert greater control over the decompression operation, use theFDecompressImage
function, described in the next section.